<?php

namespace app\admin\validate;

use think\Validate;

class Fields extends Validate
{
    
	protected $rule = [
        'model_id'     =>'require',
		'type'         =>'require',
		'cname'        =>'require|unique:fields',
		'ename'        =>'require|unique:fields',
    ];
    
   
    protected $message = [
        'model_id.require'  =>'所属模型不能为空',
        'type.require'      =>'字段类型不能为空',
        'cname.require'     =>'字段中文名称不能为空',
        'ename.require'     =>'字段英文名称不能为空',
        'cname.unique'      =>'字段中文名称不能重复',
        'ename.unique'      =>'字段英文名称不能重复',
    ];
    protected $scene=[
		'save'=>['model_id','type','cname','ename'],
		'edit'=>['model_id','type','cname','ename'],
	];
}
 